package com.ruoyi.dataserver.line.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum LayerEnum {

    DHX("DHX","电话管线","DHX_LINE","DHX_POINT"),
    GDX("GDX","供电管线","GDX_LINE","GDX_POINT"),
    GXG("GXG","管沟","GXG_LINE","GXG_POINT"),
    JTX("JTX","交通信号管线","JTX_LINE","JTX_POINT"),
    LDX("LDX","路灯管线","LDX_LINE","LDX_POINT"),
    SSG("SSG","给水管线","SSG_LINE","SSG_POINT"),
    TRQ("TRQ","天然气管线","TRQ_LINE","TRQ_POINT"),
    WSG("WSG","污水管线","WSG_LINE","WSG_POINT"),
    YSG("YSG","雨水管线","YSG_LINE","YSG_POINT"),
    ZSG("ZSG","中水管线","ZSG_LINE","ZSG_POINT"),
    ;

    private String code;
    private String description;
    private String lineTableName;
    private String pointTableName;

    public static LayerEnum getLayerEnumWithCode(String code){
        if (code == null || code.isEmpty()){
            return null;
        }
        for (LayerEnum layerEnum : LayerEnum.values()) {
            if (code.equals(layerEnum.getCode())){
                return  layerEnum;
            }
        }
        return null;
    }
}
